<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        body {
            font: 12px/1.5 "微软雅黑";
            text-align: center;
        }

        code,
        input,
        button {
            font-family: inherit;
        }

        input {
            border: 1px solid #ccc;
            padding: 3px;
        }

        button {
            cursor: pointer;
        }
    </style>
    <script>
        var Fn= function(a,b){
            alert(a.value);
            alert(b.value);
        };
        window.onload = function(){
            var input = document.getElementsByTagName("input");
            var btn = document.getElementsByTagName("button")[0];
            btn.onclick = function(){
                Fn(input[0],input[1]);
            }
        }
    </script>
</head>

<body>
    <p><input type="text" value="汉中市" /></p>
    <p><input type="text" value="南郑区" /></p>
    <p><button>传参</button></p>

</body>

</html>